<template>
	<view class="video_box" :style="{ '--color': vuex_config.themeColor1 }">
		<!-- 视频列表 -->
		<view class="video_list">
			<view class="video_list_item" v-for="(item, index) in dataList" :key="index" @click="onClick(item.pk_id)">
				<image class="video_list_item-img" :src="$formatImg(item.img)" mode=""></image>
				<view class="cont_title u-line-1">{{ item.name }}</view>
				<view class="prcie_how ">
					<view class="video-price spac u-line-1">￥{{ item.price }}</view>
					<view class="video-how spac  u-line-1">热度：{{ item.view }}</view>
				</view>
			</view>
		</view>
		<sww-load-more :params="dataListParams" @load="_load_data"></sww-load-more>
		<sww-login></sww-login>
	</view>
</template>
<script>
import { pagingMixin } from '@/mixins/pagingMixin.js';
import { wxConfig } from '@/mixins/wxConfig';
import { pageShare } from '@/mixins/pageShare';
export default {
	mixins: [pageShare, wxConfig, pagingMixin],
	onLoad(options) {
		this.initPage(options.id);
	},

	onShareAppMessage: function() {
		return this.getShareAppMessage();
	},
	onShareTimeline: function() {
		return this.getShareTimeline();
	},
	methods: {
		initPage(type) {
			this._init_data('GetVideoList', {
				type
			});
		},
		_onReachBottom() {
			this._load_data();
		},
		searchConfirm() {
			this.initPage();
		},
		//点击视频
		onClick(id) {
			this.$linkTo(`/package/video/details/index?id=${id}`);
		}
	}
};
</script>

<style lang="scss">
.video_list {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	padding: 0 24rpx;

	.video_list_item {
		width: calc(100% / 2 - 12rpx);
		height: 100%;
		border-radius: 10rpx;
		padding-bottom: 30rpx;
	}

	.video_list_item-img {
		width: 100%;
		height: 200rpx;
		border-radius: 10rpx;
	}

	.cont_title {
		font-size: 28rpx;
		font-family: PingFang;
		font-weight: 500;
		color: #333333;
		margin: 10rpx 0;
	}

	.video-price {
		color: #f82424;
		font-size: 28rpx;
	}

	.prcie_how {
		display: flex;
		justify-content: space-between;
		font-size: 20rpx;
		align-items: center;
	}

	.spac {
		width: calc(50% - 20rpx);
	}

	.video-how {
		text-align: right;
		color: #999;
	}
}
</style>
